script_enemy_main
{
        let csd     = GetCurrentScriptDirectory;
	let speed = GetSpeed;
	let angle = GetAngle;
	let num = GetArgument;
	let imgEnemy=csd~"..\lib\fairy_red.png";

	let SelectedDifficult=GetCommonDataDefault("SELECTEDDIFFICULT","Normal");

    @Initialize {
        SetLife(600);
        SetDamageRate(100,100);
	SetTexture(imgEnemy);
	Initialize_Fairy(7);
	Tmain;
	}

    @MainLoop {
	BulletNum=GetEnemyShotCount;
	ascent(let i in -1..2)
	{
	SetSkyCollision(GetX+i*16,GetY,32);
	}
	SetDummySkyCollision(GetX+50,GetY,24);
	SetDummySkyCollision(GetX-50,GetY,24);
	//MSDSetCollisionAForBigEnemy(GetX,GetY,16);
	yield;
    }

        @DrawLoop {
		SetColor(ZakoColor[0],ZakoColor[1],ZakoColor[2]);
		DrawFairy(imgEnemy);
		DrawMagicCircle("BLUE",0.50);
	}

        @Finalize
        {
		MagicCircleBreak(GetX,GetY,2,0.5);
		FinalizeItemAndShotnumWithDelete(3);
        } 

task Tmain
{
yield;
OutDamageRateZero;
AutoErazeTime(1500);
GetDamege;
move;
summon;

alternative(GetCommonDataDefault("SELECTEDDIFFICULT","None"))
case("Moderate")
{
shotM;
}
case("Extream")
{
shotE;
}
case("Apocalypse")
{
shotA;
}

}

task summon
{
        CreateEnemyFromScript("Familiar", GetX, GetY,
                              0, 0, 1);
        CreateEnemyFromScript("Familiar", GetX, GetY,
                              0, 0, -1);
}

task move
{
	SetSpeed(GetSpeed);
	SetAngle(GetAngle);
}


task shotM
{
wait(45);
MShot;
let angle=60;
loop(60)
{
	ascent(let i in 0..2)
	{
		SkyCreateShot01(GetX+50,GetY,3,180*i+angle,9,5);
		SkyCreateShot01(GetX-50,GetY,3,180*i-angle,9,5);
	}
	wait(10);
	angle+=5;
}

	task MShot
	{
		wait(60);
		loop(8)
		{
		let Mangle=GetAngleToPlayer;
		loop(3)
		{
		ascent(i in -2..3)
		{
			SkyCreateShot01(GetX,GetY,4.5,Mangle+i*20,150,15);
		}
		wait(5);
		}
		wait(60);
		}
	}

}
///////////////////////////////////////////////////////////////
task shotE
{
wait(45);
EShot;
let angle=60;
loop(120)
{
	ascent(let i in 0..4)
	{
		SkyCreateShot01(GetX+50,GetY,3,90*i+angle,9,5);
		SkyCreateShot01(GetX-50,GetY,3,90*i-angle,9,5);
	}
	wait(5);
	angle+=5;
}

	task EShot
	{
		wait(60);
		loop(8)
		{
		let Mangle=GetAngleToPlayer;
		loop(3)
		{
		ascent(i in -4..5)
		{
			SkyCreateShot01(GetX,GetY,4.5,Mangle+i*15,150,15);
		}
		wait(5);
		}
		wait(60);
		}
	}

}
//////////////////////////////////////////////////////////////
task shotA
{
wait(45);
AShot;
let angle=75;
loop(120)
{
	ascent(let i in 0..6)
	{
		SkyCreateShot01(GetX+50,GetY,4,60*i+angle,9,5);
		SkyCreateShot01(GetX-50,GetY,4,60*i-angle,9,5);
		SkyCreateShot01(GetX+50,GetY,4.5,60*i+angle,9,5);
		SkyCreateShot01(GetX-50,GetY,4.5,60*i-angle,9,5);
		SkyCreateShot01(GetX+50,GetY,4.25,60*i+angle,9,5);
		SkyCreateShot01(GetX-50,GetY,4.25,60*i-angle,9,5);
	}
	wait(5);
	angle+=5;
}

	task AShot
	{
		wait(60);
		loop(8)
		{
		let Mangle=GetAngleToPlayer;
		loop(5)
		{
		ascent(i in -6..7)
		{
			SkyCreateShot01(GetX,GetY,4.5,Mangle+i*10,150,15);
		}
		wait(3);
		}
		wait(60);
		}
	}

}

#include_function ".\..\txt/StageEnemydata.txt"
#include_function ".\..\lib\lib_anime_fairy.txt"
}

script_enemy Familiar {
    let csd     = GetCurrentScriptDirectory;
	let num = GetArgument;
    @Initialize {
	SetCoordinateType(COODINATE_TYPE_PARENT);
	let num = GetArgument;
        SetLife(50000);
        SetDamageRateEx(100,100,100,100);
	TMain;
    }

    @MainLoop {
	SetServantSkyCollision(GetX,GetY,24);
	//MSDSetCollisionAForBigEnemy(GetX,GetY,24);
	//MSDSetCollisionB(GetX,GetY,8);
	SetX(50*num);
	SetY(0);
        yield;
    }

    @DrawLoop {
    //    DrawGraphic(GetX, GetY);
    }

        @Finalize
        {
		MagicCircleBreak(GetX,GetY,11,0.3);
        } 

    task TMain {
        yield;
	ElementalEffect(0,0,255,0.8);
	OutDamageRateZero;
	GetDamege;
	ElementalAutoErazeTime(1490);
    }

#include_function ".\..\txt/StageEnemydata.txt"
}

#include_script ".\..\txt/EnemyShotData.txt"